#include "parameterwidget.h"
#include "myglwidget.h"

ParameterWidget::ParameterWidget(MyGLWidget* glwg, QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	glWidget = glwg;

	this->setMinimumWidth(300);
	//combobox mode
	connect(ui.cmbMode, SIGNAL(currentIndexChanged(int)), glWidget, SLOT(changeNPRMode(int)));
	//contour
	connect(ui.sldStrokeSize, SIGNAL(valueChanged(int)), glWidget, SLOT(changeContourStrokeSize(int)));

	connect(ui.sldScanlinePaceX, SIGNAL(valueChanged(int)), glWidget, SLOT(changeScanlinePaceX(int)));

	connect(ui.sldScanlinePaceY, SIGNAL(valueChanged(int)), glWidget, SLOT(changeScanlinePaceY(int)));

	connect(ui.cmbContourTexture, SIGNAL(currentIndexChanged(int)), glWidget, SLOT(changeContourTexture(int)));

	//volume data
	connect(ui.sldSmoothness, SIGNAL(valueChanged(int)), glWidget, SLOT(changeSmoothness(int)));

	//stippling
	connect(ui.sldDmax, SIGNAL(valueChanged(int)), glWidget, SLOT(changeDmaxValue(int)));
	connect(ui.sldFactor, SIGNAL(valueChanged(int)), glWidget, SLOT(changeFactorValue(int)));
	connect(ui.sldPointSize, SIGNAL(valueChanged(int)), glWidget, SLOT(changePointSize(int)));
	connect(ui.sldAdvect, SIGNAL(valueChanged(int)), glWidget, SLOT(changeAdvectStep(int)));
	connect(ui.sldEdgeThres, SIGNAL(valueChanged(int)), glWidget, SLOT(changeEdgeThres(int)));
	connect(ui.cbContourEnhance, SIGNAL(stateChanged(int)), glWidget, SLOT(setContourEnhance(int)));

	//hatching
	connect(ui.sldHatchStrokeSize, SIGNAL(valueChanged(int)), glWidget, SLOT(changeHatchStrokeSize(int)));
	connect(ui.cmbHatchStrokeTexture, SIGNAL(currentIndexChanged(int)), glWidget, SLOT(changeHatchTexture(int)));
	connect(ui.sldKvalue, SIGNAL(valueChanged(int)), glWidget, SLOT(changeKValue(int)));
	connect(ui.cbRenderContour, SIGNAL(stateChanged(int)), glWidget, SLOT(setRenderContour(int)));
	connect(ui.sldHatchEdgeThres, SIGNAL(valueChanged(int)), glWidget, SLOT(changeHatchEdgeThres(int)));

	//other
	connect(ui.cbBoudingBox, SIGNAL(stateChanged(int)), glWidget, SLOT(setRenderBounding(int)));
	connect(ui.cb2Dsmooth, SIGNAL(stateChanged(int)), glWidget, SLOT(set2Dsmooth(int)));
	connect(ui.sldLightAlpha, SIGNAL(valueChanged(int)), glWidget, SLOT(changeLightAlpha(int)));
	connect(ui.sldLightPhi, SIGNAL(valueChanged(int)), glWidget, SLOT(changeLightPhi(int)));
	connect(ui.sldNSlices, SIGNAL(valueChanged(int)), glWidget, SLOT(changeNSlices(int)));
	connect(ui.cbSubsampling, SIGNAL(stateChanged(int)), glWidget, SLOT(setSubsampling(int)));

	//billboard
	connect(ui.sldBillboardContour, SIGNAL(valueChanged(int)), glWidget, SLOT(change(int)));
}

ParameterWidget::~ParameterWidget()
{

}
